package com.exercise.widgets

import android.view.LayoutInflater
import com.exercise.struct.ext.start
import com.exercise.struct.base.BaseActivity
import com.exercise.struct.viewmodel.BaseViewModel
import com.exercise.textfont.EmojiActivity
import com.exercise.widgets.actionbar.ActionBarActivity
import com.exercise.widgets.buttons.ButtonsActivity
import com.exercise.widgets.chip.ChipActivity
import com.exercise.widgets.databinding.ActivityMainBinding
import com.exercise.widgets.datetime.DateTimeActivity
import com.exercise.widgets.dialog.DialogActivity
import com.exercise.widgets.edittext.EditTextActivity
import com.exercise.widgets.floatingbutton.FloatingButtonActivity
import com.exercise.widgets.menu.MenuActivity
import com.exercise.widgets.menu.OptionMenuActivity
import com.exercise.widgets.recyclerview.ListActivity
import com.exercise.widgets.searchable.SearchEntryActivity
import com.exercise.widgets.settings.PreferenceActivity
import com.exercise.widgets.spinner.SpinnerActivity
import com.exercise.widgets.switchbar.SwitchActivity
import com.exercise.widgets.textview.TextViewActivity
import com.exercise.widgets.viewpager2.ViewPager2Activity

class MainActivity : BaseActivity<BaseViewModel, ActivityMainBinding>() {
    override val bindingInflater: (LayoutInflater) -> ActivityMainBinding
        get() = ActivityMainBinding::inflate
    override val modelClass: Class<BaseViewModel>
        get() = BaseViewModel::class.java

    override fun initData() {

    }

    override fun initView() {
        binding.floatingButton.setOnClickListener {
            start(FloatingButtonActivity::class.java)
        }
        binding.viewPager2.setOnClickListener {
            start(ViewPager2Activity::class.java)
        }
        binding.editText.setOnClickListener {
            start(EditTextActivity::class.java)
        }
        binding.textView.setOnClickListener {
            start(TextViewActivity::class.java)
        }
        binding.listView.setOnClickListener {
            ListActivity.start(this)
        }
        binding.spinner.setOnClickListener {
            SpinnerActivity.start(this)
        }
        binding.actionBar.setOnClickListener {
            ActionBarActivity.start(this)
        }
        binding.menu.setOnClickListener {
            MenuActivity.start(this)
        }
        binding.dateTime.setOnClickListener {
            DateTimeActivity.start(this)
        }
        binding.buttons.setOnClickListener {
            ButtonsActivity.start(this)
        }
        binding.chips.setOnClickListener {
            ChipActivity.start(this)
        }
        binding.preferences.setOnClickListener {
            PreferenceActivity.start(this)
        }
        binding.searchable.setOnClickListener {
            SearchEntryActivity.start(this)
        }
        binding.switchBtn.setOnClickListener {
            SwitchActivity.start(this)
        }
        binding.dialogBtn.setOnClickListener {
            DialogActivity.start(this)
        }
        binding.emojiBtn.setOnClickListener {
            EmojiActivity.start(this)
        }
    }
}